import redis.clients.jedis.Jedis;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Veng Su 1344114844@qq.com
 * @date 2018/4/19 16:22
 */
public class MapRedis {
    public static void main(String[] args) {
        Jedis jedis=new Jedis("127.0.0.1",6379);//
        Map<String,String> map=new HashMap<String, String>();
        map.put("java","coder520");
        map.put("python","coder");
        map.put("suveng","suwenguang");
        jedis.hmset("maptest",map);
        System.out.println(jedis.hget("maptest","java"));//拿一个field
        System.out.println(jedis.hmget("maptest","java","python"));//拿几个field
        System.out.println(jedis.hgetAll("maptest"));//拿全部field
    }
}
